package com.learner.pojo.course;


import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author ice2020x
 * @Description: 基础课程信息
 */
@Data
@ToString
@Entity
@Table(name = "course_base")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@EntityListeners(AuditingEntityListener.class)
public class CourseBase implements Serializable {
    private static final long serialVersionUID = -1L;

    public static final String COURSE_DRAFT = "202001";
    public static final String COURSE_NORMAL = "202002";

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(length = 32)
    private String id;
    private String name;
    @Column(name = "user_id")
    private String userId;
    private String mt;
    private String st;
    private String users;

    /**
     * 课程等级  初级:200001 中级:200002 高级:200003
     */
    private String grade;
    private String description;
    private String status;

    private String studyModel;

    /**
     * 先修课程
     */
    private String ap;
    /**
     * 课程封面
     */
    private String pic;
    /**
     * 课程价格
     */
    private BigDecimal price;
    /**
     * 讲师或机构名字
     */
    @Column(name = "teacher_name")
    private String teacherName;

    @Column(name = "buy_count")
    private Long buyCount;

    @Column(name = "view_count")
    private Long viewCount;


    @Column(name = "lesson_num")
    private Short lessonNum;


    @CreatedDate
    @Column(name = "gmt_create")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @LastModifiedDate
    @Column(name = "gmt_modified")
    private Date gmtModified;


}
